package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.TenantYqItem;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zjj
 * @date 2023/6/15
 */
public interface TenantYqItemMapper {
    /**
     * 创建卷总表
     * @param yqItem
     * @return
     */
    int createYqItemTable(TenantYqItem yqItem);

    int insertItem(TenantYqItem item);

    int insertItemDisperse(TenantYqItem item);

    int updateItemDisperse(TenantYqItem item);

    int updateItem(TenantYqItem item);

    Map<String, Object> getItemById(@Param("column") String column, @Param("id")Long id, @Param("itemTableName")String itemTableName);

    Map<String, Object> getItemAllById(@Param("column") String column, @Param("id")Long id, @Param("itemTableName")String itemTableName);

    int updateItemByIds(@Param("item")TenantYqItem item, @Param("ids") Long[] ids);

    int updateItemDisperseByIds(@Param("item")TenantYqItem item, @Param("ids") Long[] ids);

    Integer getCountByCol(@Param("checkChongfu")String checkChongfu, @Param("val")String val, @Param("itemTableName")String itemTableName);

    int delItemByIds(@Param("itemIds")String itemIds, @Param("tableName") String tableName);

    int delItemDisperseByIds(@Param("itemIds")String itemIds, @Param("tableName") String tableName);

    Map<String, Object> selectBtCreateBy(@Param("itemId") Long itemId,
                                         @Param("itemTableName") String itemTableName);

    int updateItemSum(@Param("colName")String colName, @Param("num") int num, @Param("tableName") String tableName, @Param("itemId") String itemId);

    int updateItemSumDisperse(@Param("colName")String colName, @Param("num") int num, @Param("tableName") String tableName, @Param("itemId") String itemId);

    int updateStateByPackageId(@Param("state")int state,@Param("itemTableName") String itemTableName,@Param("onLineTableName") String onLineTableName,@Param("onlineReceptionId")Long onlineReceptionId);

    void delItemByIdList(@Param("tableName")String tableName,@Param("ids") List<Long> ids);

    Long[] getIdsByState(@Param("ids")Long[] ids, @Param("tableName")String itemTableName,@Param("daId")String daId,@Param("field")String field,@Param("val")String val);
}
